﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SamplingInspection.aspx.cs" Inherits="PPAP.Web.SearchReport.SamplingInspection" %>
<%@ Register Assembly="PPAP.WebControls" Namespace="PPAP.WebControls" TagPrefix="cc1" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
     <script language="javascript">
         function add() {
             url = "PPAPTasksEdit.aspx";
             PopUpWindow(url, 400, 150, 580, 400);
         }
         function edit(id, sid) {
             url = "../todolist/SampleCardWeb.aspx?RID=" + id + "&SID=" + sid + "&his=1";
             window.location.href = url;
         }
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
    <table width="890px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    Filter SET
                </td>
            </tr>
            <tr>
                <td>
                    Part No.:
                </td>
                <td>
                    <cc1:PartNo ID="tbPartno" runat="server"></cc1:PartNo>
                </td>
                <td>
                    Supplier Code:
                </td>
                <td>
                    <asp:TextBox ID="tbSupplierNo" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Create from:
                </td>
                <td>
                    <cc1:My97 ID="dpStartTime1" runat="server"></cc1:My97>
                    to:<cc1:My97 ID="dpStartTime2" runat="server"></cc1:My97>
                </td>
                <td>
                    End time:
                </td>
                <td>
                    <cc1:My97 ID="dpEndTime1" runat="server"></cc1:My97>
                    to:<cc1:My97 ID="dpEndTime2" runat="server"></cc1:My97>
                </td>
            </tr>
            <tr>
                <td>
                    Department:
                </td>
                <td>
                    <asp:DropDownList ID="ddlDept" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    Dept.rep:</td>
                <td>
                    <asp:TextBox ID="tbDeptRep" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Status:
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server">
                        <asp:ListItem Value="-1">All</asp:ListItem>
                        <asp:ListItem Value="0">Created</asp:ListItem>
                        <asp:ListItem Value="1">Circulating</asp:ListItem>
                        <asp:ListItem Value="2">Circulating(Reject)</asp:ListItem>
                        <asp:ListItem Value="3">Decided</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    Result:</td>
                <td>
                    <asp:DropDownList ID="ddlResult" runat="server">
                        <asp:ListItem Value="">All</asp:ListItem>
                        <asp:ListItem Value="G">Green</asp:ListItem>
                        <asp:ListItem Value="Y">Yellow</asp:ListItem>
                        <asp:ListItem Value="R">Red</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="left" colspan="2">
                    <asp:CheckBox ID="chkMycase" runat="server" Text="My case" />
                </td>
                <td align="center">
                    &nbsp;
                </td>
                <td align="right" style=" padding-right:30px;" >
                    <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                &nbsp;
                    <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" 
                        OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" OnLoad="dgLoad" AutoGenerateColumns="False"
            runat="server">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="No.">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="PPARNo" HeaderText="PPAR.No">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="BDNTPartNo" HeaderText="Part.No">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="SupplierCode" HeaderText="Suppiler code">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="SampleCardNo" HeaderText="Sample card No.">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="testitemname" HeaderText="Department">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="DeptRep" HeaderText="Dept.rep">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="ShowStatus" HeaderText="Status">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="Result" HeaderText="Result">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Start time">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%#Eval("starttime").ToString()==""?"":DateTime.Parse(Eval("starttime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="End time（planned）">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%#Eval("endtimeplan").ToString()==""?"":DateTime.Parse(Eval("endtimeplan").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                          <asp:TemplateColumn HeaderText="View" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="View" onclick="<%#"javascript:edit("+Eval("rid")+","+Eval("ID")+");" %>" />
                        </ItemTemplate>
                        </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
         <webdiyer:AspNetPager ID="AspNetPager2"  runat="server" Width="100%"  CssClass="paginator"
                                ShowPageIndexBox="Always" 
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
                                HorizontalAlign="Center" PageSize="20" EnableTheming="true" 
                        AlwaysShow="True" FirstPageText="|&lt;"
                                LastPageText="&gt;|" NextPageText="&gt;" 
                        PrevPageText="&lt;" SubmitButtonText="Go"
                                TextAfterPageIndexBox="page" 
                        InvalidPageIndexErrorMessage="Page index is not effective numerical！" 
                        onpagechanged="AspNetPager2_PageChanged" 
                        PageIndexOutOfRangeErrorMessage="Page index beyond range" 
            BackColor="#E7E8E8" >
                            </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
